package com.icloud.system.boot.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@TableName("admin_operation_log")
@ApiModel(value = "AdminOperationLog对象", description = "操作日志")
public class AdminOperationLog implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("账号ID")
    @TableField("admin_user_id")
    private Long adminUserId;

    @ApiModelProperty("用户名")
    @TableField("username")
    private String username;

    @ApiModelProperty("请求URI")
    @TableField("request_uri")
    private String requestUri;

    @ApiModelProperty("请求路径")
    @TableField("request_path")
    private String requestPath;

    @ApiModelProperty("请求参数")
    @TableField("request_params")
    private String requestParams;

    @ApiModelProperty("IP地址")
    @TableField("ip")
    private String ip;

    @ApiModelProperty("地区信息")
    @TableField("address")
    private String address;

    @ApiModelProperty("浏览器请求信息")
    @TableField("`user_agent`")
    private String userAgent;

    @ApiModelProperty("操作描述")
    @TableField("`desc`")
    private String desc;

    @ApiModelProperty("请求结果：1->成功，2->失败")
    @TableField("request_result")
    private Integer requestResult;

    @ApiModelProperty("失败原因")
    @TableField("failed_reason")
    private String failedReason;

    @ApiModelProperty("备注")
    @TableField("`remark`")
    private String remark;

    @ApiModelProperty("创建时间")
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @ApiModelProperty("修改时间")
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
}
